package com.nuoniu.sibanyun.service.cm.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nuoniu.sibanyun.entity.cm.CmContractFile;
import com.nuoniu.sibanyun.mapper.cm.CmContractFileMapper;
import com.nuoniu.sibanyun.service.cm.ICmContractFileService;
import com.nuoniu.sibanyun.userThread.UserInfo;
import com.nuoniu.sibanyun.userThread.UserThreadLocal;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 合同附件 服务实现类
 * </p>
 *
 * @author 小啊刚
 * @since 2021-10-20
 */
@Service
public class CmContractFileServiceImpl extends ServiceImpl<CmContractFileMapper, CmContractFile> implements ICmContractFileService {

    @Override
    public List<CmContractFile> getList(CmContractFile file) {
        UserInfo userInfo = UserThreadLocal.get();
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("company_id", userInfo.getCompanyId());
        wrapper.eq("contract_id", file.getContractId());
        return list(wrapper);
    }
}
